LIBRARY IEEE; 
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
USE WORK.control_sm;

--TESTBENCH DA MAQUINA DE ESTADO

ENTITY tb_csm IS
END tb_csm;

ARCHITECTURE logic OF tb_csm IS

COMPONENT control_sm
    PORT(clock: IN STD_LOGIC := '0';
        chosen: IN STD_LOGIC_VECTOR(1 DOWNTO 0) := "10";
		  ic: IN STD_LOGIC_VECTOR(11 DOWNTO 0) := "000000000000";
        reset: OUT STD_LOGIC := '1';
        filter_enable: OUT STD_LOGIC := '0';
        address: OUT STD_LOGIC_VECTOR(9 DOWNTO 0) := "0000000000";
        test_state: OUT STD_LOGIC_VECTOR(4 DOWNTO 0) := "00000");
END COMPONENT;

FOR tb_csm: control_sm USE ENTITY WORK.control_sm;

SIGNAL s_clock, s_reset, s_fe: STD_LOGIC := '0';
SIGNAL s_test_state: STD_LOGIC_VECTOR(4 DOWNTO 0):= "00000";
SIGNAL s_chosen: STD_LOGIC_VECTOR(1 DOWNTO 0) := "10";
SIGNAL s_ic: STD_LOGIC_VECTOR(11 DOWNTO 0) := "000000000000";

BEGIN
    tb_csm: control_sm
    PORT MAP(clock=>s_clock, chosen=>s_chosen, ic=>s_ic, 
        reset=>s_reset, filter_enable=>s_fe, test_state=>s_test_state);
    PROCESS
        TYPE pattern_type IS RECORD
            vi_clock, vo_reset, vo_fe: STD_LOGIC;
				vi_chosen: STD_LOGIC_VECTOR(1 DOWNTO 0);
				vi_ic: STD_LOGIC_VECTOR(11 DOWNTO 0);
				vo_test_state: STD_LOGIC_VECTOR(4 DOWNTO 0);
        END RECORD;
        TYPE pattern_ARRAY IS ARRAY (NATURAL RANGE <>) OF pattern_type;
            CONSTANT patterns : pattern_ARRAY :=
            (
                ('0', '1', '0', "00", "000000000000", "00000"),--START (CI DESCONHECIDO)
		          ('1', '1', '0', "00", "000000000000", "00000"),--RESET ALL
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--FIRST CHECK
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '0', '1', "00", "000000000000", "00000"),--ANALYSIS 0
					 ('0', '0', '1', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--SEE RESULT
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--NEW TEST
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--CLEAN REGS
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--UPDATE REGS
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "10", "000001111111", "00000"),--FIRST CHECK(DETECTANDO AND2)
					 ('0', '0', '0', "10", "000001111111", "00000"),
					 ('1', '0', '1', "10", "000000011100", "00000"),--ANALYSIS 0
					 ('0', '0', '1', "10", "000000011100", "00000"),
					 ('1', '0', '0', "10", "000000011100", "00000"),--TEST 1
					 ('0', '0', '0', "10", "000000011100", "00000"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--TESTING
					 ('0', '0', '1', "10", "000000011100", "00001"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--ADD ADDRESS
					 ('0', '0', '1', "10", "000000011100", "00001"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--TESTING
					 ('0', '0', '1', "01", "000000000100", "00001"),
					 ('1', '0', '0', "01", "000000000100", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000000100", "00000"),
					 ('1', '0', '0', "01", "000000000100", "00000"),--ANALYSIS 1
					 ('0', '0', '0', "01", "000000000100", "00000"),
					 ('1', '0', '0', "01", "000000000100", "00000"),--FINAL CHECK
					 ('0', '0', '0', "01", "000000000100", "00000"),
					 ('1', '0', '0', "01", "000000000100", "00000"),--IC1 CHECK
					 ('0', '0', '0', "01", "000000000100", "00000"),
					 ('1', '0', '1', "01", "000000000100", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000000100", "10001"),
					 ('1', '0', '1', "01", "000000000100", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000000100", "10001"),
					 ('1', '0', '1', "01", "000000000100", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000000100", "10001"),
					 ('1', '0', '1', "01", "000000000100", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000000100", "10001"),
					 ('1', '0', '1', "01", "000000000100", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000000100", "10001"),
					 ('1', '0', '1', "01", "000000000100", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000000100", "10001"),
					 ('1', '0', '1', "01", "000000000100", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000000100", "10001"),
					 ('1', '0', '0', "01", "000000000100", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000000100", "00000"),
					 ('1', '0', '0', "01", "000000000100", "00000"),--SEE RESULT
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--NEW TEST
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--CLEAN REGS
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--UPDATE REGS
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "10", "000001111111", "00000"),--FIRST CHECK(DETECTANDO OR2)
					 ('0', '0', '0', "10", "000001111111", "00000"),
					 ('1', '0', '1', "10", "000000011100", "00000"),--ANALYSIS 0
					 ('0', '0', '1', "10", "000000011100", "00000"),
					 ('1', '0', '0', "10", "000000011100", "00000"),--TEST 1
					 ('0', '0', '0', "10", "000000011100", "00000"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--TESTING
					 ('0', '0', '1', "10", "000000011100", "00001"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--ADD ADDRESS
					 ('0', '0', '1', "10", "000000011100", "00001"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--TESTING
					 ('0', '0', '1', "10", "000000011000", "00001"),
					 ('1', '0', '0', "10", "000000011000", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "10", "000000011000", "00000"),
					 ('1', '0', '0', "10", "000000011000", "00000"),--ANALYSIS 1
					 ('0', '0', '0', "10", "000000011000", "00000"),
					 ('1', '0', '0', "10", "000000011000", "00000"),--TEST 2
					 ('0', '0', '0', "10", "000000011000", "00000"),
					 ('1', '0', '1', "10", "000000011000", "00010"),--TESTING
					 ('0', '0', '1', "10", "000000011000", "00010"),
					 ('1', '0', '1', "10", "000000011000", "00010"),--ADD ADDRESS
					 ('0', '0', '1', "10", "000000011000", "00010"),
					 ('1', '0', '1', "10", "000000011000", "00010"),--TESTING
					 ('0', '0', '1', "10", "000000011000", "00010"),
					 ('1', '0', '0', "01", "000000001000", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000001000", "00000"),
					 ('1', '0', '0', "01", "000000001000", "00000"),--ANALYSIS 2
					 ('0', '0', '0', "01", "000000001000", "00000"),
					 ('1', '0', '0', "01", "000000001000", "00000"),--FINAL CHECK
					 ('0', '0', '0', "01", "000000001000", "00000"),
					 ('1', '0', '0', "01", "000000001000", "00000"),--IC1 CHECK
					 ('0', '0', '0', "01", "000000001000", "00000"),
					 ('1', '0', '1', "01", "000000001000", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000001000", "10001"),
					 ('1', '0', '1', "01", "000000001000", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000001000", "10001"),
					 ('1', '0', '1', "01", "000000001000", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000001000", "10001"),
					 ('1', '0', '1', "01", "000000001000", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000001000", "10001"),
					 ('1', '0', '1', "01", "000000001000", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000001000", "10001"),
					 ('1', '0', '1', "01", "000000001000", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000001000", "10001"),
					 ('1', '0', '1', "01", "000000001000", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000001000", "10001"),
					 ('1', '0', '0', "01", "000000001000", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000001000", "00000"),
					 ('1', '0', '0', "01", "000000001000", "00000"),--SEE RESULT
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--NEW TEST
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--CLEAN REGS
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--UPDATE REGS
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "10", "000001111111", "00000"),--FIRST CHECK(DETECTANDO XOR2)
					 ('0', '0', '0', "10", "000001111111", "00000"),
					 ('1', '0', '1', "10", "000000011100", "00000"),--ANALYSIS 0
					 ('0', '0', '1', "10", "000000011100", "00000"),
					 ('1', '0', '0', "10", "000000011100", "00000"),--TEST 1
					 ('0', '0', '0', "10", "000000011100", "00000"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--TESTING
					 ('0', '0', '1', "10", "000000011100", "00001"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--ADD ADDRESS
					 ('0', '0', '1', "10", "000000011100", "00001"),
					 ('1', '0', '1', "10", "000000011100", "00001"),--TESTING
					 ('0', '0', '1', "10", "000000011000", "00001"),
					 ('1', '0', '0', "10", "000000011000", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "10", "000000011000", "00000"),
					 ('1', '0', '0', "10", "000000011000", "00000"),--ANALYSIS 1
					 ('0', '0', '0', "10", "000000011000", "00000"),
					 ('1', '0', '0', "10", "000000011000", "00000"),--TEST 2
					 ('0', '0', '0', "10", "000000011000", "00000"),
					 ('1', '0', '1', "10", "000000011000", "00010"),--TESTING
					 ('0', '0', '1', "10", "000000011000", "00010"),
					 ('1', '0', '1', "10", "000000011000", "00010"),--ADD ADDRESS
					 ('0', '0', '1', "10", "000000011000", "00010"),
					 ('1', '0', '1', "10", "000000011000", "00010"),--TESTING
					 ('0', '0', '1', "10", "000000011000", "00010"),
					 ('1', '0', '0', "01", "000000010000", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000010000", "00000"),
					 ('1', '0', '0', "01", "000000010000", "00000"),--ANALYSIS 2
					 ('0', '0', '0', "01", "000000010000", "00000"),
					 ('1', '0', '0', "01", "000000010000", "00000"),--FINAL CHECK
					 ('0', '0', '0', "01", "000000010000", "00000"),
					 ('1', '0', '0', "01", "000000010000", "00000"),--IC1 CHECK
					 ('0', '0', '0', "01", "000000010000", "00000"),
					 ('1', '0', '1', "01", "000000010000", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000010000", "10001"),
					 ('1', '0', '1', "01", "000000010000", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000010000", "10001"),
					 ('1', '0', '1', "01", "000000010000", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000010000", "10001"),
					 ('1', '0', '1', "01", "000000010000", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000010000", "10001"),
					 ('1', '0', '1', "01", "000000010000", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000010000", "10001"),
					 ('1', '0', '1', "01", "000000010000", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000010000", "10001"),
					 ('1', '0', '1', "01", "000000010000", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000010000", "10001"),
					 ('1', '0', '0', "01", "000000010000", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000010000", "00000"),
					 ('1', '0', '0', "01", "000000010000", "00000"),--SEE RESULT
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--NEW TEST
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--CLEAN REGS
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--UPDATE REGS
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "10", "000001111111", "00000"),--FIRST CHECK(DETECTANDO NAND2)
					 ('0', '0', '0', "10", "000001111111", "00000"), 
					 ('1', '0', '1', "01", "000000000001", "00000"),--ANALYSIS 0
					 ('0', '0', '1', "01", "000000000001", "00000"),
					 ('1', '0', '0', "01", "000000000001", "00000"),--FINAL CHECK
					 ('0', '0', '0', "01", "000000000001", "00000"),
					 ('1', '0', '0', "01", "000000000001", "00000"),--IC1 CHECK
					 ('0', '0', '0', "01", "000000000001", "00000"),
					 ('1', '0', '1', "01", "000000000001", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000000001", "10001"),
					 ('1', '0', '1', "01", "000000000001", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000000001", "10001"),
					 ('1', '0', '1', "01", "000000000001", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000000001", "10001"),
					 ('1', '0', '1', "01", "000000000001", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000000001", "10001"),
					 ('1', '0', '1', "01", "000000000001", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000000001", "10001"),
					 ('1', '0', '1', "01", "000000000001", "10001"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000000001", "10001"),
					 ('1', '0', '1', "01", "000000000001", "10001"),--TESTING
					 ('0', '0', '1', "01", "000000000001", "10001"),
					 ('1', '0', '0', "01", "000000000001", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000000001", "00000"),
					 ('1', '0', '0', "01", "000000000001", "00000"),--SEE RESULT
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--NEW TEST
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--CLEAN REGS
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--UPDATE REGS
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "10", "000001111111", "00000"),--FIRST CHECK(DETECTANDO NOT1)
					 ('0', '0', '0', "10", "000001111111", "00000"),
					 ('1', '0', '1', "01", "000000000010", "00000"),--ANALYSIS 0
					 ('0', '0', '1', "01", "000000000010", "00000"),
					 ('1', '0', '0', "01", "000000000010", "00000"),--FINAL CHECK
					 ('0', '0', '0', "01", "000000000010", "00000"),
					 ('1', '0', '0', "01", "000000000010", "00000"),--IC2 CHECK
					 ('0', '0', '0', "01", "000000000010", "00000"),
					 ('1', '0', '1', "01", "000000000010", "10010"),--TESTING
					 ('0', '0', '1', "01", "000000000010", "10010"),
					 ('1', '0', '1', "01", "000000000010", "10010"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000000010", "10010"),
					 ('1', '0', '1', "01", "000000000010", "10010"),--TESTING
					 ('0', '0', '1', "01", "000000000010", "10010"),
					 ('1', '0', '0', "01", "000000000010", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000000010", "00000"),
					 ('1', '0', '0', "01", "000000000010", "00000"),--SEE RESULT
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--NEW TEST
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--CLEAN REGS
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--UPDATE REGS
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "10", "000001111111", "00000"),--FIRST CHECK(DETECTANDO NAND3)
					 ('0', '0', '0', "10", "000001111111", "00000"),
					 ('1', '0', '1', "01", "000000100000", "00000"),--ANALYSIS 0
					 ('0', '0', '1', "01", "000000100000", "00000"),
					 ('1', '0', '0', "01", "000000100000", "00000"),--FINAL CHECK
					 ('0', '0', '0', "01", "000000100000", "00000"),
					 ('1', '0', '0', "01", "000000100000", "00000"),--IC3 CHECK
					 ('0', '0', '0', "01", "000000100000", "00000"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--TESTING
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--TESTING
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--TESTING
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--TESTING
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--TESTING
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--TESTING
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--TESTING
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '1', "01", "000000100000", "10011"),--TESTING
					 ('0', '0', '1', "01", "000000100000", "10011"),
					 ('1', '0', '0', "01", "000000100000", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000000100000", "00000"),
					 ('1', '0', '0', "01", "000000100000", "00000"),--SEE RESULT
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--NEW TEST
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--CLEAN REGS
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--UPDATE REGS
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "10", "000001111111", "00000"),--FIRST CHECK(DETECTANDO NAND4)
					 ('0', '0', '0', "10", "000001111111", "00000"),
					 ('1', '0', '1', "01", "000001000000", "00000"),--ANALYSIS 0
					 ('0', '0', '1', "01", "000001000000", "00000"),
					 ('1', '0', '0', "01", "000001000000", "00000"),--FINAL CHECK
					 ('0', '0', '0', "01", "000001000000", "00000"),
					 ('1', '0', '0', "01", "000001000000", "00000"),--IC4 CHECK
					 ('0', '0', '0', "01", "000001000000", "00000"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--ADD ADDRESS
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '1', "01", "000001000000", "10100"),--TESTING
					 ('0', '0', '1', "01", "000001000000", "10100"),
					 ('1', '0', '0', "01", "000001000000", "00000"),--UPDATE RESULT
					 ('0', '0', '0', "01", "000001000000", "00000"),
					 ('1', '0', '0', "01", "000001000000", "00000"),--SEE RESULT
					 ('0', '0', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--NEW TEST
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '1', '0', "00", "000000000000", "00000"),--CLEAN REGS
					 ('0', '1', '0', "00", "000000000000", "00000"),
					 ('1', '0', '0', "00", "000000000000", "00000"),--UPDATE REGS
					 ('0', '0', '0', "00", "000000000000", "00000")
             );
    BEGIN
        FOR i IN patterns'RANGE LOOP
            s_clock <= patterns(i).vi_clock;
            s_chosen <= patterns(i).vi_chosen;
            s_ic <= patterns(i).vi_ic;
				
            WAIT FOR 100 ps;
            ASSERT s_reset = patterns(i).vo_reset REPORT "VALOR ERRADO NO RESET" SEVERITY error;
            ASSERT s_fe = patterns(i).vo_fe REPORT "VALOR ERRADO NO CONTROLE DO FILTRO" SEVERITY error;
            ASSERT s_test_state = patterns(i).vo_test_state REPORT "VALOR ERRADO NO SINAL DO TIPO" SEVERITY error;
        END LOOP;
        ASSERT false REPORT "END of test." SEVERITY note;
        WAIT;
    END PROCESS;
END logic;
